package com.xdjd.mobile.business.dao.mapper.activity;

import com.xdjd.mobile.business.entity.model.activity.ActivityChallengeRecordPo;
import com.xdjd.mobile.business.entity.vo.ChallengeMyPkResult;
import com.xdjd.mobile.business.entity.vo.ChallengeMyPkVO;
import com.xdjd.mobile.business.entity.vo.ChallengeRoomInfoVO;
import net.oschina.durcframework.easymybatis.dao.CrudDao;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface ActivityChallengeRecordPoDao extends CrudDao<ActivityChallengeRecordPo> {
    @Update("update activity_challenge_record set challenge_count=challenge_count+1 where record_no=#{recordNo} and challenge_count<100")
    int addChallengeCountLock(@Param("recordNo")String recordNo);

    @Update("update activity_challenge_record set step_number=#{stepNumber} where member_id=#{memberId} and record_date=CURDATE()")
    void updateTodayStepByMemberId(@Param("memberId")Long memberId,@Param("stepNumber")Long stepNumber);

    ChallengeRoomInfoVO challengeRoomInfo(String recordNo);

    List<String> getChallengerImages(String recordNo);

    ChallengeMyPkResult challengeMyPk(@Param("id")Long id, @Param("recordNo")String recordNo);

    List<ChallengeMyPkVO> getChallengeMyPkVOS(@Param("recordNo")String recordNo,@Param("roomerStep") Long roomerStep);
}